package TUILag;
import java.util.HashMap;
/**
 * 
 * 
 * @author (Lackshan, Mikkel, Nick, patrick, Simon, Yousef) 
 * @project (Tema design)
 * @version (2014.11.04)
 */
public class MainMenuUI
{
    private InputReader reader = new InputReader();
    private HashMap<String, Object> subMenus = new HashMap<String, Object>();

    /**
     * Constructor for objects of class MainMenuUI
     */
    public MainMenuUI(){
        subMenus.put("1", new PersonUI());
        subMenus.put("2", "hej med dig");
    }
    
    public void run(){
        boolean finished = false;
        printMainMenu();
        
        while(!finished) {
            String choise = reader.getInput();

            switch(choise){
                case "1": 
                    PersonUI subUI = new PersonUI();
                    subUI.run();
                    break;
                case "2": 
                    finished=true;
                    subUI = new PersonUI();
                    break;
                case "3":
                    finished=true;
                    subUI = new PersonUI();
                    break;
                case "4":
                    finished=true;
                    System.out.println("Bye!");
                    break;
                default:
                    System.out.println("Not a command");
                
            }
            printMainMenu();
        }
    }
    
    private void printMainMenu(){
        System.out.println("*****************\n ** Main Menu **\n*****************");
        System.out.println(" 1. Friends");
        System.out.println(" 2. DVDs");     
        System.out.println(" 3. Loan");
        System.out.println(" 4. Close");
    }
    
    private void addSubmenu(String key, String name, Object submenuUI){
        //SubMenu newSubMenu = new SubMenu(name, submenuUI); 
        //subMenus.put(key, newSubMenu);
    }
}
